import request from '@/utils/request'

export function getPermissionList(data) {
  return request({
    url: '/auth/permission/query/page',
    method: 'post',
    data
  })
}

export function addPermission(data) {
  return request({
    url: '/auth/permission/insertPermission',
    method: 'post',
    data
  })
}

export function editPermission(data) {
  return request({
    url: '/auth/permission/updatePermission',
    method: 'put',
    data
  })
}

export function deletePermission(data) {
  return request({
    url: '/auth/permission/delete/' + data.permissionId,
    method: 'delete',
    data
  })
}

export function getInfoByRoleIdWithAll(data) {
  return request({
    url: '/auth/permission/query/infoByRoleIdWithAll/' + data.roleId,
    method: 'post',
    data
  })
}
